package com.ruoyi.wb.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wb.domain.WbBanner;
import com.ruoyi.wb.mapper.WbBannerMapper;
import com.ruoyi.wb.service.IWbBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * banner图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-14
 */
@Service
public class WbBannerServiceImpl implements IWbBannerService 
{
    @Autowired
    private WbBannerMapper wbBannerMapper;

    /**
     * 查询banner图片
     * 
     * @param id banner图片主键
     * @return banner图片
     */
    @Override
    public WbBanner selectWbBannerById(Long id)
    {
        return wbBannerMapper.selectWbBannerById(id);
    }

    /**
     * 查询banner图片列表
     * 
     * @param wbBanner banner图片
     * @return banner图片
     */
    @Override
    public List<WbBanner> selectWbBannerList(WbBanner wbBanner)
    {
        return wbBannerMapper.selectWbBannerList(wbBanner);
    }

    /**
     * 新增banner图片
     * 
     * @param wbBanner banner图片
     * @return 结果
     */
    @Override
    public int insertWbBanner(WbBanner wbBanner)
    {
        wbBanner.setCreateTime(DateUtils.getNowDate());

        return wbBannerMapper.insertWbBanner(wbBanner);
    }

    /**
     * 修改banner图片
     * 
     * @param wbBanner banner图片
     * @return 结果
     */
    @Override
    public int updateWbBanner(WbBanner wbBanner)
    {
        wbBanner.setUpdateTime(DateUtils.getNowDate());
        return wbBannerMapper.updateWbBanner(wbBanner);
    }

    /**
     * 批量删除banner图片
     * 
     * @param ids 需要删除的banner图片主键
     * @return 结果
     */
    @Override
    public int deleteWbBannerByIds(Long[] ids)
    {
        return wbBannerMapper.deleteWbBannerByIds(ids);
    }

    /**
     * 删除banner图片信息
     * 
     * @param id banner图片主键
     * @return 结果
     */
    @Override
    public int deleteWbBannerById(Long id)
    {
        return wbBannerMapper.deleteWbBannerById(id);
    }
}
